Loading header...

Analog vs Digital Signals

Analog signals represent continuously varying physical quantities. Digital signals represent values with a limited set of states, usually logic 0 and logic 1. Practical electronics uses both: sensors and power circuits are analog, while processors, memory, and firmware are digital.

Learning Objectives

By the end of this lesson, you should be able to define analog and digital signals, explain sampling and quantization, calculate ADC code size, identify aliasing risk, and describe a real sensor-to-controller signal chain.

Analog Signals

An analog signal can take any value within a range.

$$
V(t) \in [V_{min}, V_{max}]
$$

Temperature, pressure, sound, light, position, and motor current are naturally analog. Analog circuits preserve details, but they are sensitive to noise, offset, drift, loading, bandwidth, and component tolerance.

Digital Signals

A digital signal uses defined states. In binary logic the states are LOW and HIGH. The voltage is still analog, but the receiver interprets it using thresholds.

flowchart LR LOW[LOW region] --> UNDEF[Undefined region] UNDEF --> HIGH[HIGH region]

Digital systems are easier to store, copy, transmit, check, and process. The trade-off is that analog information must be sampled and quantized before software can use it.

ADC Bridge

An analog-to-digital converter samples voltage at discrete times and converts each sample to a number.

$$
t_n = nT_s
$$

For an ideal N-bit unipolar ADC:

$$
Levels = 2^N
$$

$$
LSB = \frac{V_{REF}}{2^N}
$$

For a 12-bit ADC with VREF = 3.3 V:

$$
LSB = \frac{3.3}{4096} = 0.000805 V = 0.805 mV
$$

Sampling and Aliasing

A sampled system must sample fast enough for the information it needs. A common rule from Nyquist theory is:

$$
f_s > 2f_{max}
$$

In practical embedded systems, designers often sample much faster than twice the signal bandwidth and use an anti-aliasing filter before the ADC.

DAC and PWM Bridge

A digital-to-analog converter produces an analog voltage or current from a code. PWM can also approximate analog output after filtering.

flowchart LR SENSOR[Analog sensor] --> AFE[Amplifier and filter] AFE --> ADC[ADC] ADC --> MCU[Digital processing] MCU --> DAC[DAC or PWM] DAC --> LOAD[Analog actuator]

Worked Example

A sensor maps 0 V to 5 V into 0 degC to 100 degC. A 10-bit ADC reports code 512 with VREF = 5 V.

$$
V_{in} = \frac{512}{1023} \times 5 V \approx 2.50 V
$$

$$
Temperature \approx \frac{2.50}{5.00} \times 100 = 50 degC
$$

The code is digital, but the voltage, sensor accuracy, reference tolerance, and noise remain analog concerns.

Common Mistakes

  • Assuming digital means exact voltage values.
  • Sampling slowly and missing aliasing.
  • Ignoring ADC reference accuracy.
  • Feeding an ADC from a source impedance higher than the datasheet allows.
  • Forgetting that digital edges can inject noise into analog measurements.

Practical Checks

Check signal range, sensor bandwidth, anti-alias filter, ADC resolution, reference tolerance, input impedance, grounding, and whether the software calculation uses correct units and calibration constants.

Summary

Analog signals sense and drive the real world. Digital signals store and process information robustly. ADCs, DACs, filters, references, and layout connect the two domains reliably.

Further Reading

  • Analog Devices, Data Conversion Handbook.
  • Microchip and ST application notes on ADC input design.
  • Horowitz and Hill, The Art of Electronics, chapters on signals and data conversion.

Mind Map

mindmap root((Analog and digital)) Core concept Analog continuous Digital discrete states Conversion links both Applications Sensors Audio Motor control MCU measurement Formulas Levels equals 2 to N LSB equals Vref over 2 to N fs greater than 2 fmax Code maps to voltage Design rules Filter before ADC Use stable Vref Respect thresholds Separate noisy edges Practical checks Range and headroom Source impedance Aliasing test Calibration units Common mistakes Exact digital voltage myth Slow sampling Bad reference No anti alias filter